package com.tao.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.UUID;

/**
 * @ClassName ConsulProverController
 * @Author HETAO
 * @Date 2020/5/10 0:34
 */
@RestController
@RequestMapping("/consul")
@Slf4j
public class ConsulProverController {
    @Resource
    private RestTemplate restTemplate;

    @Value("${server.port}")
    private String serverPort;

    @GetMapping
    public String getProvoider() {
        return "Springcloud with consul"+serverPort+"\t"+UUID.randomUUID().toString();
    }
}
